package com.grm.demo.xianchengchi;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class CachedThreadPoolDemo {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newCachedThreadPool();
        for (int i = 0; i < 6; i++) {
            int j = i;
            executorService.execute(new Runnable() {
                @Override
                public void run() {
                    System.out.println(j);
                }
            });
        }
    }
}
